package com.hist.dao;

import com.hist.pojo.User;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

/**
 * @auther Ren Gaoshuai
 * @date 2021-04-07 17:08
 **/
public class UserMapperImpl implements UserMapper{

    /**
     * 所有的操作都有sqlSession对象完成
     */
    private SqlSessionTemplate sqlSession;

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }

    public List<User> queryUser() {
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        return mapper.queryUser();
    }
}
